import { http } from "@/utils/http";
// import { baseUrlApi } from "@/api/utils";
import { baseUrlApi } from "@/api/utils";
type Result = {
  current_page: number;
  result?: any;
  per_page?: number;
  total?: number;
  data?: any;
  resultTree?: any;
};
type ResultCreate = {
  code?: any;
  msg?: any;
  result?: any;
};
/** 列表 */
export const getDeptTree = (params?: object) => {
  return http.request<Result>("get", baseUrlApi + "/dashboard/department/listTree", {
    params
  });
};
/** 创建 */
export const create = (data?: object) => {
  return http.request<ResultCreate>("post", baseUrlApi + "/dashboard/department/store", {
    data
  });
};
/** 修改 */
export const update = (data?: object) => {
  return http.request<ResultCreate>("put", baseUrlApi + "/dashboard/department/update", {
    data
  });
};
/** 删除 */
export const del = (data?: object) => {
  return http.request<ResultCreate>(
    "delete",
    baseUrlApi + "/dashboard/department/delete",
    {
      data
    }
  );
};
